<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <span v-if="isUser">
            用户账号：<input id="username" key="username" placeholder="请输入账号" type="text">
        </span>
        <span v-else>
            用户邮箱：<input type="text" id="email" placeholder="请输入邮箱" key="email">
        </span>
        <button @click="btnClick">切换登录类型</button>
    </div>
</body>
<script src="../js/http_cdn.bootcdn.net_ajax_libs_vue_2.6.6_vue.js"></script>
<script>
    new Vue({
        el: "#app",
        data: {
            isUser: true,
        },
        methods: {
            btnClick() {
                this.isUser = !this.isUser
            }
        },
    })
</script>

</html>
